#include "../CShortRouteEstimateCostCalculator.h"

#include "astar/private/map.h"

#include <math.h>

CShortRouteEstimateCostCalculator::CShortRouteEstimateCostCalculator()
{
}

CShortRouteEstimateCostCalculator::~CShortRouteEstimateCostCalculator()
{
}

bool CShortRouteEstimateCostCalculator::calculate(const key & k, const key & end, cost & cst)
{
   int iCurX = 0;
   int iCurY = 0;
   int iEndX = 0;
   int iEndY = 0;
   Key2XY(k, iCurX, iCurY);
   Key2XY(end, iEndX, iEndY);

   cst = abs(iCurX - iEndX) + abs(iCurY - iEndY);

   return true;
}
